import React, { Component } from 'react'
import PropTypes from "prop-types"
export class Son extends Component {
    // static propTypes ={
    //     flag:PropTypes.bool,
    //     list:PropTypes.array.isRequired,//必传项
    //     name:PropTypes.string,
    //     num:PropTypes.number
    // }
    //默认props参数
    // static defaultProps = {
    //     name:"周文强",
    // }

    render() {
        console.log(this.props);
        let {list,name,num} = this.props
        return (
            <div>
                Son
                <p>list:{list}</p>
                <p>name:{name}</p>
                <p>age:{num}</p>
            </div>
        )
    }
}


Son.propTypes ={
    flag:PropTypes.bool,
    list:PropTypes.array.isRequired,//必传项
    name:PropTypes.string,
    num:PropTypes.number
}

Son.defaultProps = {
    name:"周文强",
        
}

export default Son
